using SqlSugar;
using System;
using B.S.XZYData.Domain.BaseEntities;

namespace B.S.XZYData.Domain.ZSHH
{
    /// <summary>
    /// 装配工单产品明细表
    /// </summary>
    [SugarTable("assembly_work_order_product_detail")]
    public class AssemblyWorkOrderProductDetail : BaseModel
    {
        /// <summary>
        /// 装配工单ID(外键)
        /// </summary>
        [SugarColumn(IsNullable = false)]
        public long WorkOrderId { get; set; }

        /// <summary>
        /// 层级编号
        /// </summary>
        [SugarColumn(Length = 20, IsNullable = false)]
        public string HierarchyNumber { get; set; }

        /// <summary>
        /// 产品编号
        /// </summary>
        [SugarColumn(Length = 50, IsNullable = false)]
        public string ProductNumber { get; set; }

        /// <summary>
        /// 产品名称
        /// </summary>
        [SugarColumn(Length = 100, IsNullable = false)]
        public string ProductName { get; set; }

        /// <summary>
        /// 产品规格
        /// </summary>
        [SugarColumn(Length = 200, IsNullable = true)]
        public string ProductSpecification { get; set; }

        /// <summary>
        /// 工单编号
        /// </summary>
        [SugarColumn(Length = 50, IsNullable = true)]
        public string WorkOrderDetailNumber { get; set; }

        /// <summary>
        /// 数量
        /// </summary>
        [SugarColumn(IsNullable = false)]
        public int Quantity { get; set; }

        /// <summary>
        /// 完成数
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public int? CompletedQuantity { get; set; } = 0;

        /// <summary>
        /// 重写基类的Updator字段，确保新增时可以为空
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public override string? Updator { get; set; }

        /// <summary>
        /// 重写基类的UpdatorDate字段，确保新增时可以为空
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public override DateTime? UpdatorDate { get; set; }

        /// <summary>
        /// 导航属性 - 装配工单
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        public AssemblyWorkOrder AssemblyWorkOrder { get; set; }
    }
} 